<?php
namespace app\admin\model;

use think\Db;

class Collection extends Common{
    protected $table='collection';
    public function pageCn($where=[]){
        $pagesize = 5;
        return Db::name($this->table)
            ->alias('b')
            ->field('a.*,count(b.question_id) as aaa')
            ->where($where)
            ->join('question a','b.question_id=a.q_id','right')
            ->group('a.q_id')
            ->paginate($pagesize,false);
    }
}